package s47.dqj.dao;

import java.util.List;

import javax.annotation.Resource;

import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;

import s47.dqj.bean.MedicalRecallType;

/**
 * 17.药品召回类型表
 * @author Administrator
 *
 */
@Repository("medicalRecallTypeDaoImpl")
public class MedicalRecallTypeDaoImpl extends HibernateDaoSupport implements MedicalRecallTypeDaoInf{
	
	/* (non-Javadoc)
	 * @see s47.dqj.dao.MedicalRecallTypeDaoInf#setSupperSessionFactory(org.hibernate.SessionFactory)
	 */
	@Override
	@Resource(name="sessionFactory")
	public void setSupperSessionFactory(SessionFactory sessionFactory){
		super.setSessionFactory(sessionFactory);
	}
	/* (non-Javadoc)
	 * @see s47.dqj.dao.MedicalRecallTypeDaoInf#findAll()
	 */
	@Override
	public List<MedicalRecallType> findAll(){
		String hql="from MedicalRecallType";
		return getHibernateTemplate().find(hql);
	}
	/* (non-Javadoc)
	 * @see s47.dqj.dao.MedicalRecallTypeDaoInf#save(s47.dqj.bean.MedicalRecallType)
	 */
	@Override
	public void save(MedicalRecallType medicalRecallType){
		getHibernateTemplate().save(medicalRecallType);
	}
	/* (non-Javadoc)
	 * @see s47.dqj.dao.MedicalRecallTypeDaoInf#update(s47.dqj.bean.MedicalRecallType)
	 */
	@Override
	public void update(MedicalRecallType medicalRecallType){
		getHibernateTemplate().update(medicalRecallType);
	}
	/* (non-Javadoc)
	 * @see s47.dqj.dao.MedicalRecallTypeDaoInf#delete(s47.dqj.bean.MedicalRecallType)
	 */
	@Override
	public void delete(MedicalRecallType medicalRecallType){
		getHibernateTemplate().delete(medicalRecallType);
	}
}
